The upper bound of cumulative return of a trading series

We present an upper bound of cumulative return in financial trading time series to formulate the most possible profit of many trades. The bound can be used to formally analyze the cumulative return varied by the number of trades, the mean return, and transaction cost rate. We also prove and show the validation of the upper bound, and verify the trend of cumulative return is consistent with that of the proposed bound via simulation experiments. Introducing a set of stochastic assessment methodology based on bootstrap into the organization of experimental data, we illustrate the influence on cumulative return from the relationship between the mean of return and transaction cost rate, technical trading rules, and stock indexes. To the best of our knowledge, this is the first to present and prove a bound of cumulative return of a stock trading series in theory. Both theoretical analyses and simulation experiments show the presented bound is a good mathematical tool to evaluate the trading risks and chances using given trading rules in stock trading markets.


I. Introduction
A cumulative return on an investment is the aggregate amount that the investment has gained or lost over time by many trades. A trade series refers to the chain of buy and sell trading events on a stock during a period of time. The main goal of stock investments is to achieve big cumulative return, but not big return of one trade. The motivation of investors participating stock trading is to obtain value-added profit through many times via buy and sell trades. How much can you earn on earth after you buy and sell a stock for many times? We focus on studying this problem in this paper.
However, the stock investment is often quite risky, for the stock price is always affected by political, macro or micro economic events [1]. To pursue high profits, the professional investors participating in stock trading would like to hire fundamental analysis and/or technical analysis to make decisions in stock markets [2]. Empirical evidence has shown that both fundamental and technical analysis can help to achieve great profits in stock market investment [3]. For lack of enough financial advantage and information superiority, unprofessional individual investors probably become victims when institutional investors manipulate stock price PLOS ONE PLOS ONE | https://doi.org/10.1371/journal.pone.0267239 April 28, 2022 1 / 12 a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 [4]. Unwilling to accept such a fact, some investors try to use technical trading rules to assist their stock trading, since a qualitative analysis of macroeconomics fundamentals is usually subjective and hard to assess [5]. Nevertheless, the effectiveness of technical trading rules still remains controversy [6][7][8][9][10][11][12], and the setting of parameters of a certain trading rules can greatly influence on the return. How to choose proper technical trading rules is therefore a significant subject for investors to make profit and avoid risk, which is one of our main objectives in this work on the bound of cumulative return. In this paper, we present an upper bound of the return, which produces a set of new approaches for evaluating the performance of technical trading rules.
The main goal of this paper is to find a kind of mathematical tool to evaluate and analyze the impact of trading behavior on the cumulative return of many trades, but not a new technical trading approach. We therefore present the maximum possible return on n times of stock trading, which can answer to how much you will earn at most for many trades. As one of the fundamental concerns in stock markets, the related literature to the cumulative return is extensive [7,8], especially on cross-sectional return [13], but there is rare published work on the bound of cumulative return in trading time series. Although using machine learning [14][15][16] and deep learning [17][18][19][20][21] for stock trading prediction is not the focus of this paper, the proposed bound can be used for studying and evaluating them as well as similar scenarios as portfolio optimization [22,23], where we could model the portfolio of multiple selected stocks as a customized index, and it is very interesting and left for us to study on the theoretical and statistical simulation in future. As for the bound of the cumulative return, prior work is often based on pricing of assets, but seldom focuses on trading behaviors. For example, [24] provided the theoretical upper bounds, and found the empirical R 2 s are more than theoretical upper bounds on predictive regression. Similarly, an important bound on cumulative return on Mean-Variance model was earlier studied by [25], which is focusing on is portfolio selection. Different from previous work, we propose an upper bound of cumulative return to evaluate and control the trading risk and profit by selecting proper trading rules in investment. The bound can be also used to formally analyze the cumulative return varied by the number of trades, the mean return, and transaction cost rate.
In this work, we first formally present an upper bound of the cumulative return, and then theoretically prove it. Using bootstrap methodology, we also investigate the effectiveness of the bound in evaluating the performance of technical trading rules on both emerging market and developed market. In short, our study makes several contributions as follows: 1. We presented and proved the upper bound of the cumulative return of stock trading, which paves a new way for formally analyzing maximal possible profit of a stock trading time series.
2. Based on the presented bound, we found and proved preliminary principles on the return of stock trading, and provided mathematically evidence for some trends and laws in stock trading fields.
3. By simulation experiments, we found the moving trend of the bound is basically ordinance with that of the trading return, which can therefore be used for evaluating the performance of trading strategies.
The rest of this paper is organized as follows. Section II first presented the theoretical model on the upper bound of the cumulative return in general stock trading behaviors, and then prove the bound and its relevant corollary. Section III introduced experimental dataset, methods, used technical rules, results and some analyses. Finally, Section IV made our conclusions and prospected the forthcoming work.

II. The upper bound of cumulative return
To present the upper bound of cumulative return, we first formulate the mathematical model on the general stock trading activities. The symbols used in this section are listed in Table 1.
Assume P is a time series of stock trading, the return of the i-th trade, in no consideration of transaction cost, is defined as, Here, P( � ) represents the stock price at a given time � , here, s i denotes the time of i-th buy event, and b i denotes the time of i-th sell event.
In consideration of transaction costs, the cumulative return of n trades R(n) can be formulated by: Here, n is the number of trades, and Cost i represents the transaction costs in the i-th trade, which can be approximately considered as Cost i �k�P(s i ), and here k denotes transaction cost rate. Why the approximation of Cost i is only related to the sell price but not taken the buy price is that the fore is much more than the latter in real stock market, referring relevant rules of trading cost to [26]. To simplify the model of cumulative return, we regarded k as a constant in this paper, and can obtain: (1), and substitute it into the above Equation, we can obtain: Based on the above model, we present theorem 1 to formulate the upper bound of R(n) defined as Eq (3).

PLOS ONE
How much can you earn at most for many trades?
Theorem 1 (Upper bound) 8n>0, 9R(n) satisfies the following inequality: Here � r ¼ 1 n P n i¼1 r i ; k is the transaction cost rate, the upper bound is noted as UB, i.e., To prove the upper bound is correct, we need to prove the inequality (4). Before proving UB, we first introduce preliminary knowledge on D-I inequality as follows, which is proposed and proved by Dragomir and Ionescu [27].

D-I inequality:
Let f:I�R!R be a differentiable convex function on I, x i 2I and p i �0(i = 1,. . .,n) with P n ≔ P n i¼1 P i > 0. Then we have the inequality as follows, Then, using the D-I inequality, we prove the upper bound of cumulative return R(n), i.e., Theorem 1:

Proof of Theorem 1:
Let G(n) = −ln R(n), according to in Eq (3), then In the D-I inequality, we let p i = 1, so P n ≔ P n i¼1 P i ¼ n, and f(x) = −ln x. It is easily to certify that f(x) is a differentiable convex function on (0,+1) because the second derivative of f(x) is greater than 0 when x2(0,+1) (see Eq (8)): Let x i = 1+r i , here, −1�r i , because the minimum of P(s i ) is zero, the in Eq (6) can be transformed into: With the assistance of Eq. (9) and the Eq. (7), G(n) can be further derived: here, � r ¼ 1 n P n i¼1 r i , and considering that G(n) = −ln R(n), we can further obtain: Then, the upper bound of R(n) and Theorem 1 have been proved.

End of proof.
Here we have proved the upper bound of Theorem 1 using D-I inequality, and there are still other methods to be able to perform the proof of UB, such as AM-GM inequality, Cauchy inequality.
According to UB and Theorem 1, we can derive some corollaries about cumulative returns as follows:

End of proof
Obviously, corollary 1 reveals the that when the number of trades (n) increases to infinity, the cumulative returns will converge to 0 if the mean of returns is less than transaction cost rate, i.e., � r � k, which means investors will lose all the money after these trades. In addition, we indicate the trend of upper bound with the increase of k and n in Fig 1. Easy to find when � r � k, the declining situation of the upper bound with n is small, while when n is large enough, the upper bound would become close to zero. This is in line with Corollary 1.
On the country of corollary 1, the UB will increase with n if the mean of returns is more than transaction cost rate, i.e., � r > k:∵UB ¼ ½ð1 À kÞð1 þ � rÞ� n and � r > k; ; From the analysis on UB, we know that the condition of � r > k would make the cumulative return R(n) speed up the increase with n.

III. Simulation experiments
To illustrate the impact of the upper bound on cumulative returns, we design a set of experiments using historical data of stock indices. In this section, we first introduce the used data set, the used technical trading rules, sub-dataset selected by bootstrap methods, then show the validation of the upper bound, and evaluate the performance of used technical indicators for the stock indices. When � r � � k, the upper bound will decrease with the increase of k and n. Here the left sub-graph shows the situation when n is small (range from 0 to 100), while the right sub-graph shows the situation that when n is lager enough (range from 10,000 to 100,000). As shown in Fig 1,

B. Technical trading rules
It is well-known that technical trading rules are widely used in stock trading markets. In this part, we introduce several the used technical trading rules for our simulation trading

PLOS ONE
How much can you earn at most for many trades?
experiments, involving moving average convergence divergence (MACD), commodity channel index (CCI), rate of change (ROC), and random trading strategy (RND). As for a simple trading strategy [5], the random trading strategy makes trade decision (buy or sell) at the time (t) in random (here, t follows a uniform distribution with a mean of 15). Except for the random trading strategy, the technical trading rules and their formula are presented in Table 2.
Notably, the parameters of these trading rules are configured according to [30].

C. Bootstrap method
To reduce the influence of "luck" and make the results more convincing, we adopt bootstrap methodology [31] for the selection of each time experimental data. The main steps of the used bootstrap method in this paper are described as follows. 2. Generating return series and computing the cumulative return: in each test period, use a certain trading rule to make trades and obtain the corresponding return series, then compute cumulative return R i by Eq (3); 3. Repeating step 1 and step 2: repeat the above two steps for M times, then get the estimation of � R; In this paper, we let M be 1000. In this part, using the bootstrap method, we first investigate the validity of the proposed upper bound in different stock indices and then provide a method to assess the performance of trading strategies. Besides, we conduct numerous experiments on distinct stock indices to testify the validity of the proposed method.

D. Validation of the upper bound
To show the validity of proposed upper bound in real stock indices, we choose DJIA as an example to demonstrate the influence of the number of trades on the cumulative return and its upper bound. Fig 3 visualizes the results using the data of DJIA, from which we found that in no consideration of transaction cost rate and technical trading rules, the corresponding upper bound can be held, that is to say, the validity of upper bound can be verified to work well in use of the hired index data and technical indicators. The significance of this part is mainly to make a visualization by simulation trades for the proved theorem 1. Average, n denotes the number of short duration, and m denotes the number of long duration to compute the average of close prices. C t represents the close price of current time. n = 12 days, m = 26 days , here, C, L, H represent close price, low price, high price, here, n also denotes the number of short duration n = 9 days " 100 # 100 ROC ROC n ð Þ ¼ C t C tÀ n À 1 � � � 100, C represents the close price, and subscript t denotes the given moment. n = 13 days " 0 # 0 the arrows, " and # respectively mean upwards(golden)/downwards(dead) cross. https://doi.org/10.1371/journal.pone.0267239.t002

PLOS ONE
How much can you earn at most for many trades?

E. Performance evaluation of typical technical indicators
In Section II, we have proved the validity of the upper bound. Here we put forward a method to evaluate the performance of trading strategies. First, we should compute � r of the trading strategy in the selected stock index. To some extent, � r can represent the potential profitability of the technical trading rule. Also, we evaluate the performance of trading strategies according to the relationship between � r and k. If k > � r, the trading strategy will perform poorly for this stock and should be abandoned. Then, we will assess the effectiveness of this method by experiments. We divide each stock index into two equal parts, training set and testing set. By using the bootstrap methodology, we calculate the � r in training set and regard it as the � r of this stock index. Table 3 presents the � r of several technical trading rules in different stock indices. Furthermore, we just try to add transaction costs into the trading model. Transaction cost is a major factor that affects the cumulative return and always consists of two major components: explicit costs and implicit costs, the detailed information can be referred to [32]. In simplicity, we only take explicit costs into consideration and approximately measure transaction costs by transaction cost rate k in this paper. Here we show the influence of k on R(n) in different stock indices, and set the value of k range from 0.001 to 0.01 in Fig 4. Undoubtedly, the cumulative return shows a clear downward tendency when the k increase gradually, this matches our common sense. Note that, if k > � r, the cumulative return will be less than 1. For example, the � r of ROC in N225 is 0.0005 (see Table 3), which is apparently less than k. The cumulative return will be thus less than 1.   In addition, we also illustrate the influence of the number of trades n on R(n). For simplicity, here we take DJIA as an example and exhibit the results in Fig 5. From Table 3, we know the � r of the ROC, CCI, RND and MACD for DJIA is 0.0038, 0.0046, 0.0048, 0.0065, respectively. When k takes 0.007, exist k > � r, therefore according to Corollary 1, R(n) ought to show an approximately downward tendency when n increases gradually. Apparently, Fig 5 (k = 0.007) supports our Corollary 1. Anther sub-graph in Fig 5 delivers that if k < � r, it has a large probability that R(n) will increase with the n increases. Therefore, the relationship between k and � r is a crucial factor in evaluating profitability of a trading strategy in investment. If k > � r, the technical trading rule should not be adopted in the stock index. Note that, the value of k tends to be correlated with the stock market. For example, in the Chinese stock market, the transaction costs mainly consist of stamp duty (0.1% of the turnover), commission (no more than 0.3% of the turnover) and transfer fees (only charge in the Shanghai market, which is 0.006% of the denomination) [12].
In this section, we introduced a set of stochastic assessment methodology based on bootstrap into the organization of experimental data, and illustrate the influence on cumulative return from the relationship between the mean of return and transaction cost rate, technical trading rules, and stock indexes. Besides, the above-mentioned method can be also used for some new methods [7,8] to evaluate their performance. In prior work, we have studied some deep learning approaches to predict time series, which we are going to plan to use for return prediction if being customized in the future for stock trades. It will be an interesting research direction on how to fusion the bound and deep learning approaches into future stock trading behaviors.

IV. Conclusions and prospects
In this paper, we first presented an upper bound of the cumulative return for stock trading and proved its correctness in theory. Then we derive and prove a corollary from the upper bound. By the proposed boundary analysis, we interpreted why when the mean of the return rate series � r less than the transaction cost rate k, the more number of trades, the more loss. Based on the idea of Bootstrap, we furthermore proposed the method to evaluate the performance of trading strategies by using the proposed upper bound. To visualize the validity of the presented bound, using the bootstrap methodology, we conducted numerous simulation experiments to evaluate the performance of technical trading rules.
In short, we conclude that the relationship between k and � r is a crucial factor in evaluating profitability of a trading strategy in stock markets. Moreover, the proposed bound can be used to control stock trading risk. What's more, the bound can become one tool of risk control in the high-frequency trading field, for an instance, and be used to the work of [33]. On the other hand, our finding can also be used to help an investor to avoid the unnecessary trades using technical strategies by designing a specific stop-loss mechanism. Both theoretical analyses and simulation experiments showed the presented bound is a good mathematical tool to evaluate the trading risks and chances using given trading rules in stock trading markets.
In the future work, we will pay more attention to combine our finding with other trading strategies assisted by the presented bound, including but being not limited to machine learning, to provide a better guide for investors to control the risk of stock investments.